<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>


        let arr = ['张飞', '牛肉', 22, true];
        //for——of
        for (let itme of arr) {
            console.log(itme);
        }

        //for——in
        for (let index in arr) {
            console.log(index, arr[index]);
        }
        //forEach
        var arr1 = ['red', 'green', 'blue', 'skyblue', 'purple'];
        //forEach 遍历数组 for--in、  for ——of
        arr1.forEach(function (itme, index, array) {
            console.log(itme, index, array);
        })




    </script>
</body>

</html>